Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

241
Vistas
what is "is" keyword used for in JavaScript?

so i dont understand the logic behind "is" keyword (here "isSleeping") i see lots of time studying javascript.

does it mean something results boolean?

let animal = {
  walk() {
    if (!this.isSleeping) {
      alert(`I walk`);
    }
  },
  sleep() {
    this.isSleeping = true;
  }
};

let rabbit = {
  name: "White Rabbit",
  __proto__: animal
};

// modifies rabbit.isSleeping
rabbit.sleep();

alert(rabbit.isSleeping); 
alert(animal.isSleeping); 

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

"is" is not a keyword it's a way of naming your boolean variables AKA naming convention, so when other people see a variable with "is" in front they know that variable is a boolean.

By @ironmouse The same goes with "has": For example there could be functions like "hasSiblings" or "isMarried" that return a boolean type. However the return type is not set in stone but it is a good convention for developers.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda